home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / maestro / source / videbjct / videoobj.h < prev   
Encoding:
C/C++ Source or Header  |  1993-06-15  |  24.5 KB  |  655 lines

  1. /*
  2.  * Copyright (c) 1990, 1991, 1992 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, and distribute this software and 
  5.  * its documentation for any purpose is hereby granted without fee, provided
  6.  * that (i) the above copyright notices and this permission notice appear in
  7.  * all copies of the software and related documentation, and (ii) the name
  8.  * Stanford may not be used in any advertising or publicity relating to
  9.  * the software without the specific, prior written permission of
  10.  * Stanford.
  11.  * 
  12.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  13.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  14.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  15.  *
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
  17.  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
  18.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT
  19.  * ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY,
  20.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  21.  * SOFTWARE.
  22.  */
  23.  
  24. /* $Header: /Source/Media/collab/VideoObject/RCS/videoObj.h,v 0.32 92/11/17 14:46:25 drapeau Exp $ */
  25. /* $Log:    videoObj.h,v $
  26.  * Revision 0.32  92/11/17  14:46:25  drapeau
  27.  * Corrected errors in configuration of several players, especially the
  28.  * Pioneer4200 player.
  29.  * 
  30.  * Revision 0.31  92/09/03  10:24:53  drapeau
  31.  * Changed communications settings for the NEC driver configuration.
  32.  * 
  33.  * Revision 0.30  92/09/02  17:13:15  drapeau
  34.  * Added support and documentation for a new field in the Config structure,
  35.  * "flowControl".  Modified the appropriate data structures (e.g.,
  36.  * device-specific Config structs).
  37.  * 
  38.  * Revision 0.29  92/09/01  17:03:30  drapeau
  39.  * Made several changes:
  40.  * * Updated copyright notice.
  41.  * * Modified documentation to reflect addition of the two new
  42.  *   methods, DevRecord() and DevRecordFromTo().
  43.  * * Made code more ANSI-compliant through use of function prototypes.
  44.  * * Cosmetic changes to make code more readable.
  45.  * 
  46.  * Revision 0.28  92/07/30  15:13:28  drapeau
  47.  * Removed window system-specific include files.
  48.  * Also, defined "FrameRate", a default definition for frame rates to be used
  49.  * by all drivers in the library.  This definition may be overridden by the
  50.  * Makefile variables.
  51.  * 
  52.  * Revision 0.27  92/06/17  01:02:09  drapeau
  53.  * Changed termio usage, used more portable "termio" structure and
  54.  * associated calls instead of "termios".
  55.  * 
  56.  * Revision 0.26  92/06/16  23:35:19  drapeau
  57.  * Added AppClient for use by XView notify_set_input_func.
  58.  * 
  59.  * Revision 0.25  92/01/03  16:56:09  drapeau
  60.  * Removed inclusion of string.h so as not to conflict with other files
  61.  * that use this driver.
  62.  * 
  63.  * Revision 0.24  91/09/30  17:09:19  lim
  64.  * Added DevPing, DefaultPing, PlayerVerified.
  65.  * 
  66.  * Revision 0.23  91/09/27  14:32:29  lim
  67.  * Removed serialLine as a global.
  68.  * 
  69.  * Revision 0.22  91/08/24  17:50:33  lim
  70.  * Added comments at the end with configurations of devices.
  71.  * 
  72.  * Revision 0.21  91/08/24  13:59:43  lim
  73.  *  CheckImplemented corrected to return an enum Boolean.
  74.  * 
  75.  * Revision 0.20  91/08/24  13:39:36  lim
  76.  * 1. Clear Marker() removed as part of video Object.
  77.  * 
  78.  * Revision 0.19  91/08/17  20:43:59  lim
  79.  * 1. Removed 'interruptibleSegmentPlay' from video object. All stops and
  80.  * >> pauses must be implemented such that they can interrupt segment play.
  81.  * >> .
  82.  * 2. Removed 'interruptible' because no longer used.
  83.  * 
  84.  * Revision 0.18  91/08/08  17:20:09  lim
  85.  * 1. CalcSpeed() - one parameter added, 'playMode'. If playMode is 1, it is used to calculate
  86.  *    device speed for segment play. If playMode is 0, it is used to calculate device speed for
  87.  *    normal play.
  88.  * 2. QueryMedium() - one parameter added, 'result'. Used to return non-integer results.
  89.  * 
  90.  * Revision 0.17  91/08/07  13:32:23  lim
  91.  * 1. Added _VideoObjectHeader_
  92.  * 2. Added <X11/resource.h>
  93.  * 3. Added 'MyAbs' and 'MyRound'.
  94.  * 4. Removed ErrorDecode from VideoObject.
  95.  * 5. Config has new field, fd, for the file descriptor for the object.
  96.  * 
  97.  * Revision 0.16  91/08/02  13:06:39  lim
  98.  * 1. Defines for CheckImplemented() arguments.
  99.  * 2. Max speed now part of configuration structure.
  100.  * 3. VideoObject now includes configuration structure and
  101.  * Pause() has been removed.
  102.  * 4. allDevices changed from array of device configurations to array
  103.  * of names of all devices supported.
  104.  * 5.
  105.  * Added : GetDeviceMaxSpeed
  106.  *         CheckImplemented
  107.  * 
  108.  * Revision 0.15  91/07/29  22:33:26  lim
  109.  * If there is no eol char, it now means non-canonical input.
  110.  * 
  111.  * Revision 0.14  91/07/27  22:30:18  lim
  112.  * Changed speed from double to int.
  113.  * 
  114.  * Revision 0.13  91/07/23  16:01:12  lim
  115.  * Added field interruptibleSegmentPlay.
  116.  * Changed static variables to globals.
  117.  * Changed floats to doubles.
  118.  * 
  119.  * Revision 0.12  91/07/19  14:16:28  lim
  120.  * Removed old SetSerialPort function.
  121.  * 
  122.  * 
  123.  * Revision 0.11  91/07/17  22:54:46  lim
  124.  * Removed static variable currDevice.
  125.  * 
  126.  * Revision 0.10  91/07/12  16:25:53  lim
  127.  * Initial revision implementing VideoObject.
  128.  *  */
  129.  
  130. /* IMPORTANT : NAMING CONVENTION 
  131.  * ... All functions for the driver should be prefixed by ...
  132.  * ... the name of the model so as to avoid clashes with other modules ...
  133.  * ... already written.
  134.  */
  135.  
  136. #ifndef _VideoObjectHeader_
  137. #define _VideoObjectHeader_
  138.  
  139. #include <errno.h>
  140. #include <stdio.h>
  141. #include <sys/param.h>
  142. #include <sys/types.h>
  143. #include <sys/stat.h>
  144. #include <sys/termio.h>
  145. #include <sys/file.h>
  146.  
  147. #define MaxNameLength 30
  148. #define MaxPathLength 256
  149. #define MaxDevices    20
  150. #define Ok            0
  151. #define InitError     -1
  152. #define TimeOut       10                        /* Set Ping timeout to 10 seconds */
  153. #define AppClient     200
  154. #define FrameRate    30                        /* NTSC Frame Rate; override in Makefile */
  155.  
  156. #define MyAbs(n)          ((n) > 0? (n) : (-n))
  157. #define MyRound(n, d)     ((n%d)/d > 0.5? (n/d+1) : (n/d))
  158.  
  159. /* Definition of functions of the VideoObject */
  160. /* This is used in CheckImplemented, so that the user can check if a certain...
  161.  * ... VideoObject function has been implemented by the current video object. */
  162.  
  163. #define PlayFunction                     1
  164. #define PlayFromToFunction               2
  165. #define FastForwardFunction              3
  166. #define ReverseFunction                  4
  167. #define CalcSpeedFunction                5
  168. #define PlayAtSpeedDirFunction           6
  169. #define StepFunction                     7
  170. #define StillFunction                    8
  171. #define StopFunction                     9
  172. #define SetDefaultsFunction             10
  173. #define SetAudioFunction                11
  174. #define SetVideoFunction                12
  175. #define SetAddModeFunction              13
  176. #define SetAddressDisplayFunction       14
  177. #define EjectFunction                   15
  178. #define PowerFunction                   16
  179. #define QueryFrameFunction              17
  180. #define QueryChapterFunction            18
  181. #define QueryAudioFunction              19
  182. #define QueryVideoFunction              20
  183. #define QueryMediumFunction             21
  184. #define QueryStatusFunction             22
  185. #define PingFunction                    23
  186. #define RecordFunction            24
  187. #define RecordFromToFunction        25
  188.  
  189. enum Parity {Odd, Even, Any, NoParity};
  190. enum Boolean {No, Yes};
  191. enum Direction {Forward, Reverse};
  192.  
  193. /* Definition of VideoObject */
  194. /* DEFINING NEW OBJECTS 
  195.  * 1. Implement each relevant function for the device in your application.
  196.  * 2. Include file "videoObjects.c" into your application.
  197.  * 3. Modify DevInit() to include the new device. This means writing the new object
  198.  *    including the configuration structure, and setting 'myVideo' to the new
  199.  *    object if the new device is selected. 
  200.  * NOTE: Do not remove any calls made in the function, because they set up the data
  201.  *     structures for the video objects.
  202.  */
  203.  
  204.  
  205. /* Definition of Configuration */
  206. /*    The structure Config stores the configuration for the player, including serial line
  207.  * settings. This structure is stored with the video object associated with the player.
  208.  * To allow easy change of serial port connection, the serial port may be set in ~/.Xdefaults,
  209.  * using "<deviceName>.serialPort".  This setting overrides the setting in the configuration
  210.  * structure. "videoObjects.c" has to be changed and the application recompiled if there are
  211.  * changes to be made for other settings in the configuration.
  212.  *
  213.  *
  214.  * Representation of a device in Config: 
  215.  *   modelName  serialPort  baudRate  eolChar  charSize  parity  igParError flowControl maxSpeed  fileDescriptor
  216.  *
  217.  *  where : modelName is a string denoting the name of the device
  218.  *          serialPort is a string denoting the serial port to which the device is attached 
  219.  *          baudRate is an integer denoting the baud rate at which data transfer is carried out 
  220.  *          eolChar represents the ASCII value (decimal) of the character sent by the 
  221.  *             device denoting the end of a line and that a read() should be performed.
  222.  *          charSize can be 5, 6, 7 or 8
  223.  *          parity can either be Even, Odd, Any, or None 
  224.  *          igParError can be either No or Yes
  225.  *        flowControl can be either No or Yes
  226.  *          maxSpeed is an integer denoting the maximum speed in terms of frames/second that
  227.  *             the device can play
  228.  *          fileDescriptor is an integer denoting the file descriptor for the device (always initialized to -1,
  229.  *             or any negative number)
  230.  * 
  231.  *  NOTE: 
  232.  *  1. If the device does not return an end-of-line character, enter a negative number in its place.
  233.  *     It is assumed that non-canonical input processing will be used if a negative number is entered
  234.  *     for the end-of-line character. 
  235.  *     Struct termio defaults: c_cc[VMIN] = 1 and c_cc[VTIME] = 0.
  236.  *  2. If serialPort is not fixed (determined by ~/.Xdefaults file), enter 'na'.
  237.  *
  238.  * eg. 
  239.  
  240.       static Config Pioneer4200Config = 
  241.       {
  242.         "Pioneer4200",
  243.         "/dev/ttya",
  244.     4800,
  245.     13, 
  246.     8,
  247.     Even,
  248.     Yes,
  249.     Yes,
  250.     120,
  251.     -1
  252.     }
  253.     ;
  254.  
  255.       static Config Sony1550Config = 
  256.       {
  257.         "Sony1550",
  258.         "na",                               <= serial port set in ~/.Xdefaults
  259.     2400,
  260.     -1,                               <= non-canonical input processing
  261.     8,
  262.     Even,
  263.     Yes,
  264.     Yes,
  265.     90, 
  266.     -1
  267.     }
  268.     ;
  269.  
  270.      ASCII value table (Decimal) - Character
  271.  
  272.      |  0 NUL|  1 SOH|  2 STX|  3 ETX|  4 EOT|  5 ENQ|  6 ACK|  7 BEL|
  273.      |  8 BS |  9 HT | 10 NL | 11 VT | 12 NP | 13 CR | 14 SO | 15 SI |
  274.      | 16 DLE| 17 DC1| 18 DC2| 19 DC3| 20 DC4| 21 NAK| 22 SYN| 23 ETB|
  275.      | 24 CAN| 25 EM | 26 SUB| 27 ESC| 28 FS | 29 GS | 30 RS | 31 US |
  276.      | 32 SP | 33  ! | 34  " | 35  # | 36  $ | 37  % | 38  & | 39  ' |
  277.      | 40  ( | 41  ) | 42  * | 43  + | 44  , | 45  - | 46  . | 47  / |
  278.      | 48  0 | 49  1 | 50  2 | 51  3 | 52  4 | 53  5 | 54  6 | 55  7 |
  279.      | 56  8 | 57  9 | 58  : | 59  ; | 60  < | 61  = | 62  > | 63  ? |
  280.      | 64  @ | 65  A | 66  B | 67  C | 68  D | 69  E | 70  F | 71  G |
  281.      | 72  H | 73  I | 74  J | 75  K | 76  L | 77  M | 78  N | 79  O |
  282.      | 80  P | 81  Q | 82  R | 83  S | 84  T | 85  U | 86  V | 87  W |
  283.      | 88  X | 89  Y | 90  Z | 91  [ | 92  \ | 93  ] | 94  ^ | 95  _ |
  284.      | 96  ` | 97  a | 98  b | 99  c |100  d |101  e |102  f |103  g |
  285.      |104  h |105  i |106  j |107  k |108  l |109  m |110  n |111  o |
  286.      |112  p |113  q |114  r |115  s |116  t |117  u |118  v |119  w |
  287.      |120  x |121  y |122  z |123  { |124  | |125  } |126  ~ |127 DEL|
  288.  
  289. */
  290.  
  291. typedef struct _Config 
  292. {
  293.   char        modelName[MaxNameLength];
  294.   char        serialPort[15];
  295.   int        baudRate;
  296.   int        eolChar;
  297.   int        charSize;
  298.   enum Parity    parity;
  299.   enum Boolean    igParError;
  300.   enum Boolean    flowControl;
  301.   int        maxSpeed;
  302.   int        fd;
  303. } Config;
  304.  
  305.   
  306. /* COMPOSITION OF A VIDEO OBJECT
  307.  * Data structures
  308.  * 1.  Config configuration - stores the device configurations (described above).
  309.  *
  310.  * Functions
  311.  * 1.  int (*DevPlayPtr) (VideoObject* theObject) 
  312.  *     Pointer to function that puts device in 'play' mode. Returns status code.
  313.  * 2.  int (*DevPlayFromTo) (VideoObject* theObject, int startAddress, int endAddress, 
  314.  *                           int speedInFramesPerSecond)
  315.  *     Pointer to function that plays a segment. This function is used in 4 different ways.
  316.  *     (i)   startAddress == endAddress 
  317.  *           Searches to 'startAddress' and stills.
  318.  *     (ii)  startAddress != NULL, endAddress == NULL
  319.  *           Searches to 'startAddress', and continues playing at 'speedInFramesPerSecond'.
  320.  *     (iii) startAddress == NULL, endAddress != NULL
  321.  *          Play from current position (no search) until 'endAddress' at 'speedInFramesPerSecond'.
  322.  *     (iv)  startAddress != endAddress, and startAddress != NULL, and endAddress != NULL
  323.  *           Play from 'startAddress' to 'endAddress' at 'speedInFramesPerSecond'.
  324.  *     'startAddress' and 'endAddress' are in terms of frames if the player is in frame mode, 
  325.  *     and in terms of chapters if the player is in chapter mode.
  326.  *     For devices that have indices rather than chapters, and have relative search of indices,
  327.  *     'endAddress' is used to indicate direction. As usual, 0 is Forward, 1 is Reverse.
  328.  *     Returns status code.
  329.  * 3.  int (*DevFastForwardPtr) (VideoObject* theObject)
  330.  *     Pointer to function that plays forward at higher than normal (device-dependent) speed.
  331.  *     It may continue to play at this speed until some other command is issued, or it may
  332.  *     return to normal playback after a certain number of frames (device-dependent).
  333.  *     Returns status code.
  334.  * 4.  int (*DevReversePtr) (VideoObject* theObject)
  335.  *     Pointer to function that plays reverse at higher than normal (device-dependent) speed.
  336.  *     It may continue to play at this speed until some other command is issued, or it may
  337.  *     return to normal playback after a certain number of frames (device-dependent).
  338.  *     Returns status code.
  339.  * 5.  int (*DevCalcSpeedPtr) (VideoObject* theObject, int inputValue, int playMode)
  340.  *     Pointer to function that returns speed (in number of frames per second) that can be 
  341.  *     played by the device, given 'inputValue'.  'playMode' is 0 for normal playback and 1 for
  342.  *     segment play. Returns status code.
  343.  * 6.  int (*DevPlayAtSpeedDirPtr) (VideoObject* theObject, int speedInFramesPerSecond, 
  344.  *                                  enum Direction direction)
  345.  *     Pointer to function that plays at 'speedInFramesPerSecond' in 'direction'. 
  346.  *     'speedInFramesPerSecond' can either be converted to a speed the device can play, or 
  347.  *     can be any arbitrary positive speed.
  348.  *     Returns status code.
  349.  * 7.  int (*DevStepPtr) (VideoObject* theObject, enum Direction direction)
  350.  *     Pointer to function that steps one frame in 'direction.
  351.  *     Returns status code.
  352.  * 8.  int (*DevStillPtr) (VideoObject* theObject)
  353.  *     Pointer to function that puts player into 'still' mode, meaning frame is frozen,
  354.  *     but video is not muted. This function should be able to execute in any mode, which
  355.  *     means that if segment play is not interruptible by a normal pause command, an 
  356.  *     interrupt command should be used to implement pause.
  357.  *     Returns status code.
  358.  * 9.  int (*DevStopPtr) (VideoObject* theObject)
  359.  *     Pointer to function that puts player into 'stop' mode, meaning playback is stopped
  360.  *     and video is muted. It does NOT shut down the disc motor. This function should be able to
  361.  *     execute in any mode, which means that if segment play is not interruptible by a normal
  362.  *     stop command, an interrupt command should be used to implement stop.
  363.  *     Returns status code.
  364.  * 10. int (*DevSetDefaultsPtr) (VideoObject* theObject)
  365.  *     Pointer to function that puts player into desired mode when starting it up. Examples
  366.  *     of features that are set can be : audio, frame display, etc.
  367.  *     Returns status code.
  368.  * 11. int (*DevSetAudioPtr) (VideoObject* theObject, int mode)
  369.  *     Pointer to function that sets audio to 'mode' on player.
  370.  *     Returns status code.
  371.  * 12. int (*DevSetVideoPtr) (VideoObject* theObject, int mode)
  372.  *     Pointer to function that sets video to 'mode' on player.
  373.  *     Returns status code.
  374.  * 13. int (*DevSetAddModePtr) (VideoObject* theObject, int mode)
  375.  *     Pointer to function that sets addressing mode to 'mode' on player.
  376.  *     Returns status code.
  377.  * 14. int (*DevSetAddressDisplayPtr) (VideoObject* theObject, int onOff, int mode)
  378.  *     Pointer to function that either turns on-screen address display to 'on' or 'off' 
  379.  *     depending on value of 'onOff' and sets the display to 'mode'.
  380.  *     Returns status code.
  381.  * 15. int (*DevEjectPtr) (VideoObject* theObject)
  382.  *     Pointer to function that ejects the medium from the player.
  383.  *     Returns status code.
  384.  * 16. int (*DevPowerPtr) (VideoObject* theObject, int mode)
  385.  *     Pointer to function that turns power either on or off, depending on 'mode'.
  386.  *     Returns status code.
  387.  * 17. int (*DevQueryFrame) (VideoObject* theObject)
  388.  *     Pointer to function that asks the player for the current address of the medium. 
  389.  *     Returns the address in terms of frames.
  390.  * 18. int (*DevQueryChapter) (VideoObject* theObject)
  391.  *     Pointer to function that asks the player for the current chapter of the medium, and
  392.  * 19. int (*DevQueryAudio) (VideoObject* theObject)
  393.  *     Pointer to function that asks the player for status of audio output. Returns
  394.  *     audio status.
  395.  * 20. int (*DevQueryVideo) (VideoObject* theObject)
  396.  *     Pointer to function that asks the player for status of video output. Returns
  397.  *     video status.
  398.  * 21. int (*DevQueryMedium) (VideoObject* theObject, char* result)
  399.  *     Pointer to function that asks the player for medium ID. Returns the medium ID if integer,
  400.  *     or if a string, returns in 'result'.
  401.  * 22. int (*DevQueryStatus) (VideoObject* theObject)
  402.  *     Pointer to function that asks the player for its status, eg play, pause, search, etc.
  403.  *     Returns status.
  404.  * 23. int (*DevPing) (VideoObject* theObject)
  405.  *     Pointer to function that sends a command to the player that is guaranteed to elicit
  406.  *     some response from the player. It returns the number of characters read.
  407.  *     This function is used only during the installation of a driver, so that the application
  408.  *     can check if the player is correctly selected. 
  409.  * 24. int (*DevRecord) (VideoObject* theObject)
  410.  *     Pointer to function that begins normal recording on the player.  In video
  411.  *     terminology, this is known as "assemble edit".
  412.  *     Returns status code.
  413.  * 25. int (DevRecordFromTo) (VideoObject* theObject, int startAddress, int endAddress,
  414.  *                  int speedInFramesPerSecond)
  415.  *     Pointer to function that records a segment.  This function is currently used in 2
  416.  *     different ways:
  417.  *     (i)    startAddress == NULL, endAddress == NULL
  418.  *        Puts player into "Insert Edit" mode, allowing precise time-code recording
  419.  *        to occur.
  420.  *     (ii)    startAddress == 0, endAddress != 0
  421.  *        Records from current position (no search) until 'endAddress' is reached.
  422.  *     Returns status code.
  423.  *
  424.  *     Notes on DevRecordFromTo:
  425.  *    1)   Although "speedInFramesPerSecond" field is here, as with DevPlayFromTo(), it is
  426.  *              unlikely that players will allow recording at other than 1x speed.  This field
  427.  *         is here to accommodate the possibility of future devices that can record at other
  428.  *         than normal speed.
  429.  *    2)   Before use (ii) takes into effect, the player must first be put into
  430.  *         insert edit mode, by using (i).  In other words, the calling application must call
  431.  *         "DevPlayFromTo(theObject, NULL, NULL, 30)" to turn on insert edit mode, after which
  432.  *         the application may call "DevPlayFromTo(theObject, 0, endAddress, 30) to begin insert
  433.  *         edit recording.  This is done in two separate calls since some devices experience a
  434.  *         long setup time to enter insert edit mode.  The separate calls allow for better
  435.  *         synchronization between playback and record decks.
  436.  *    3)   To record a single frame of video (e.g., frame 100), call DevRecordFromTo in this
  437.  *         manner: DevRecordFromTo(theObject, 100, 100, 30).
  438.  */
  439.  
  440. typedef struct _VideoObject 
  441. {
  442.   Config* DevConfig;
  443.   int (*DevPlayPtr) (struct _VideoObject*);
  444.   int (*DevPlayFromToPtr) (struct _VideoObject*, int, int, int);
  445.   int (*DevFastForwardPtr) (struct _VideoObject*);
  446.   int (*DevReversePtr) (struct _VideoObject*);
  447.   int (*DevCalcSpeedPtr) (struct _VideoObject*, int, int);
  448.   int (*DevPlayAtSpeedDirPtr) (struct _VideoObject*, int, enum Direction);
  449.   int (*DevStepPtr) (struct _VideoObject*, enum Direction);
  450.   int (*DevStillPtr) (struct _VideoObject*);
  451.   int (*DevStopPtr) (struct _VideoObject*);
  452.   int (*DevSetDefaultsPtr) (struct _VideoObject*, int, int, int, int);
  453.   int (*DevSetAudioPtr) (struct _VideoObject*, int);
  454.   int (*DevSetVideoPtr) (struct _VideoObject*, int);
  455.   int (*DevSetAddModePtr) (struct _VideoObject*, int);
  456.   int (*DevSetAddressDisplayPtr) (struct _VideoObject*, int, int);
  457.   int (*DevEjectPtr) (struct _VideoObject*);
  458.   int (*DevPowerPtr) (struct _VideoObject*, int);
  459.   int (*DevQueryFramePtr) (struct _VideoObject*);
  460.   int (*DevQueryChapterPtr) (struct _VideoObject*);
  461.   int (*DevQueryAudioPtr) (struct _VideoObject*);
  462.   int (*DevQueryVideoPtr) (struct _VideoObject*);
  463.   int (*DevQueryMediumPtr) (struct _VideoObject*, char*);
  464.   int (*DevQueryStatusPtr) (struct _VideoObject*);
  465.   int (*DevPingPtr) (struct _VideoObject*);
  466.   int (*DevRecordPtr) (struct _VideoObject*);
  467.   int (*DevRecordFromToPtr) (struct _VideoObject*, int, int, int);
  468. } VideoObject;
  469.  
  470.  
  471.  
  472. /* DECLARATIONS */
  473.  
  474. char allDevices[MaxDevices][MaxNameLength];                /* Array of names of all devices supported */
  475. int numDevices;                                /* Total number of devices supported so far */
  476.  
  477.  
  478. int GetDeviceMaxSpeed(VideoObject*);
  479. enum Boolean CheckImplemented(VideoObject*, int);
  480.  
  481. /* Default functions for the video object */
  482.  
  483. int DefaultPlay            (VideoObject*);
  484. int DefaultPlayFromTo        (VideoObject*, int, int, int);
  485. int DefaultFastForward        (VideoObject*);
  486. int DefaultReverse        (VideoObject*);
  487. int DefaultCalcSpeed        (VideoObject*, int, int);
  488. int DefaultPlayAtSpeedDir    (VideoObject*, int, enum Direction);
  489. int DefaultStep            (VideoObject*, enum Direction);
  490. int DefaultStill        (VideoObject*);
  491. int DefaultStop            (VideoObject*);
  492. int DefaultSetDefaults        (VideoObject*, int, int, int, int);
  493. int DefaultSetAudio        (VideoObject*, int);
  494. int DefaultSetVideo        (VideoObject*, int);
  495. int DefaultSetAddMode        (VideoObject*, int);
  496. int DefaultSetAddressDisplay    (VideoObject*, int, int);
  497. int DefaultEject        (VideoObject*);
  498. int DefaultPower        (VideoObject*, int);
  499. int DefaultQueryFrame        (VideoObject*);
  500. int DefaultQueryChapter        (VideoObject*);
  501. int DefaultQueryAudio        (VideoObject*);
  502. int DefaultQueryVideo        (VideoObject*);
  503. int DefaultQueryMedium        (VideoObject*, char*);
  504. int DefaultQueryStatus        (VideoObject*);
  505. int DefaultPing            (VideoObject*);
  506. int DefaultRecord        (VideoObject*);
  507. int DefaultRecordFromTo        (VideoObject*, int, int, int);
  508.  
  509.  
  510. /* Video functions called by applications */
  511.  
  512. int DevPlay            (VideoObject*);
  513. int DevPlayFromTo        (VideoObject*, int, int, int);
  514. int DevFastForward        (VideoObject*);
  515. int DevReverse            (VideoObject*);
  516. int DevCalcSpeed        (VideoObject*, int, int);
  517. int DevPlayAtSpeedDir        (VideoObject*, int, enum Direction);
  518. int DevStep            (VideoObject*, enum Direction);
  519. int DevStill            (VideoObject*);
  520. int DevStop            (VideoObject*);
  521. int DevSetDevs            (VideoObject*, int, int, int, int);
  522. int DevSetAudio            (VideoObject*, int);
  523. int DevSetVideo            (VideoObject*, int);
  524. int DevSetAddMode        (VideoObject*, int);
  525. int DevSetAddressDisplay    (VideoObject*, int, int);
  526. int DevEject            (VideoObject*);
  527. int DevPower            (VideoObject*, int);
  528. int DevQueryFrame        (VideoObject*);
  529. int DevQueryChapter        (VideoObject*);
  530. int DevQueryAudio        (VideoObject*);
  531. int DevQueryVideo        (VideoObject*);
  532. int DevQueryMedium        (VideoObject*, char*);
  533. int DevQueryStatus        (VideoObject*);
  534. int DevPing            (VideoObject*);
  535. int DevRecord            (VideoObject*);
  536. int DevRecordFromTo        (VideoObject*, int, int, int);
  537.  
  538.  
  539. int PlayerVerified(VideoObject*, char*);
  540. int SetSerialLine(Config*, char*);
  541. VideoObject* BuildVideoObject(VideoObject*);
  542.  
  543. #endif
  544.  
  545. /* Configurations of video objects thus supported - Reference */
  546.  
  547. /* Video Object for Pioneer4200 */
  548. /*
  549. static Config Pioneer4200Config = 
  550. {
  551.   "Pioneer4200",
  552.   "na",
  553.   4800,
  554.   13,
  555.   8,
  556.   Even,
  557.   Yes,
  558.   Yes,
  559.   120,
  560.   -1
  561.   }
  562. ;
  563. */
  564.  
  565. /* Video Object for Panasonic 2026/2027 */
  566. /*
  567. static Config PanasonicOptConfig = 
  568. {
  569.   "Panasonic2026",
  570.   "/dev/ttyb",
  571.   1200,
  572.   13,
  573.   8,
  574.   Even,
  575.   Yes,
  576.   Yes,
  577.   300, 
  578.   -1
  579.   }
  580. ;
  581. */
  582.  
  583. /* Video Object for Pioneer6000 */
  584. /*
  585. static Config Pioneer6000Config = 
  586. {
  587.   "Pioneer6000",
  588.   "/dev/ttyb",
  589.   1200,
  590.   13,
  591.   8,
  592.   Even,
  593.   Yes,
  594.   Yes,
  595.   90,
  596.   -1
  597.   }
  598. ;
  599. */
  600.  
  601. /* Video Object for Sony1550 */
  602. /*
  603. static Config Sony1550Config = 
  604. {
  605.   "Sony1550",
  606.   "/dev/ttyb",
  607.   2400,
  608.   -1,
  609.   8,
  610.   Even,
  611.   Yes,
  612.   Yes,
  613.   90,
  614.   -1
  615.   }
  616. ;
  617. */
  618.  
  619. /* Video Object for NEC PC VCR */
  620. /*
  621. static Config NECConfig = 
  622. {
  623.   "NEC",
  624.   "na",
  625.   1200,
  626.   13,
  627.   8,
  628.   NoParity,
  629.   No,
  630.   No,
  631.   270,
  632.   -1
  633.   }
  634. ;
  635. */
  636.  
  637.  
  638. /* Video Object for CVD1000 */
  639. /*
  640. static Config CVD1000Config = 
  641. {
  642.   "CVD1000",
  643.   "/dev/ttya",
  644.   9600,
  645.   -1,
  646.   8,
  647.   NoParity,
  648.   No,
  649.   No,
  650.   60,
  651.   -1
  652.   }
  653. ;
  654. */
  655.